<template>
  <view class="scrollbox">
    <cu-custom style="background-color: transparent;color: white;" :isBack="false">
      <block slot="content" style="color: #f37b1d;"></block>
    </cu-custom>
    <image
        src='https://mmbiz.qpic.cn/mmbiz_jpg/8iaIEbCVSqJbPf0F2swURHf3icxEk5IiboDooNhLYDy3WBLvsiaHKSWniaTEUgG7ZQibjgsjbh3lqVLX7zwn7nwCs8fA/640?wx_fmt=jpeg&wxfrom=5&wx_lazy=1&wx_co=1'
        class="bg-set"></image>
    <view class='nav-list margin-top-xl'>
      <view @click="option(item.type)" class="nav-li"
            :style="{backgroundColor: item.bgColor, color: item.fontColor}" v-for="item in color">
        <view class="nav-title">{{ item.title }}</view>
        <view class="nav-name">{{ item.name }}</view>
        <text :class='item.icon'></text>
      </view>
    </view>
    <view class='cu-tabbar-height'></view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        CustomBar: this.CustomBar,
        color: [{
          bgColor: "rgba(28,187,180,0.9)",
          fontColor: "#fff",
          title: "金币赛",
          name: "计算器",
          icon: "cuIcon-rechargefill",
          type: "calc"
        }, {
          bgColor: "rgba(243, 123, 29, 0.9)",
          fontColor: "#fff",
          title: "金币赛",
          name: "玩法攻略",
          icon: "cuIcon-game",
          type: "echelon"
        }, {
          bgColor: "rgba(251,189,8,0.9)",
          fontColor: "#fff",
          title: "主角",
          name: "等级提升",
          icon: "cuIcon-favorfill",
          type: "level"
        }, {
          bgColor: "rgba(141,198,63,0.9)",
          fontColor: "#fff",
          title: "阵旗",
          name: "等级提升",
          icon: "cuIcon-activityfill",
          type: "flag"
        },
          {
            bgColor: "rgba(224,57,151,0.9)",
            fontColor: "#fff",
            title: "装备",
            name: "进阶材料",
            icon: "cuIcon-ticket",
            type: "material"
          }, {
            bgColor: "rgba(103,57,182,0.9)",
            fontColor: "#fff",
            title: "武将",
            name: "进化材料",
            icon: "cuIcon-pic",
            type: "evolution"
          }, {
            bgColor: "rgba(229,77,66,0.9)",
            fontColor: "#fff",
            title: "武将",
            name: "天命材料",
            icon: "cuIcon-magic",
            type: "kismet"
          }, {
            bgColor: "rgba(165,103,32,0.9)",
            fontColor: "#fff",
            title: "武将",
            name: "进阶材料",
            icon: "cuIcon-present",
            type: "materials"
          }
          // , {
          //   bgColor: "rgba(165,103,32,0.9)",
          //   fontColor: "#fff",
          //   title: "官方",
          //   name: "最新公告",
          //   icon: "cuIcon-message",
          //   type: "message"
          // }
        ],
        share: {
          title: '放开那三国工具',
          imageUrl: '',
          path: '/pages/index/index'
        }
      }
    },
    onLoad(res) {
      // uni.navigateTo({
      //   url: "/pagesA/pages/activity/activity"
      // })
    },
    methods: {
      option(type) {
        switch (type) {
          case "calc":
            uni.navigateTo({
              url: "/pagesA/pages/moneyCompetion/moneyCompetion"
            })
            break
          case "echelon":
            uni.navigateTo({
              url: "/pagesA/pages/echelon/echelon"
            })
            break
          case "level":
            uni.navigateTo({
              url: "/pagesA/pages/level/level"
            })
            break
          case "flag":
            uni.navigateTo({
              url: "/pagesA/pages/flag/flag"
            })
            break
          case "material":
            uni.navigateTo({
              url: "/pagesA/pages/material/material"
            })
            break
          case "evolution":
            uni.navigateTo({
              url: "/pagesA/pages/evolution/evolution"
            })
            break
          case "kismet":
            uni.navigateTo({
              url: "/pagesA/pages/kismet/kismet"
            })
            break
          case "materials":
            uni.navigateTo({
              url: "/pagesA/pages/materials/materials"
            })
            break
          case "message":
            uni.navigateTo({
              url: "/pagesA/pages/activity/activity"
            })
        }
      },
    }
  }
</script>
<style>
  page {
    min-height: 100%;
  }
</style>
<style>
  .scrollbox {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    overflow-y: scroll;
  }

  .bg-set {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
  }

  .scrollPage {
    height: 100vh;
  }

  .nav-list {
    display: flex;
    flex-wrap: wrap;
    padding: 0px 40rpx 0px;
    justify-content: space-between;
  }

  .nav-li {
    padding: 30rpx;
    border-radius: 12rpx;
    width: 45%;
    margin: 0 2.5% 40rpx;
    background-image: url("@/static/NyU04x.png");
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
  }

  .nav-li::after {
    content: "";
    position: absolute;
    z-index: -1;
    background-color: inherit;
    width: 100%;
    height: 100%;
    left: 0;
    bottom: -10%;
    border-radius: 10rpx;
    opacity: 0.2;
    transform: scale(0.9, 0.9);
  }

  .nav-li.cur {
    color: #fff;
    background: rgb(94, 185, 94);
    box-shadow: 4rpx 4rpx 6rpx rgba(94, 185, 94, 0.4);
  }

  .nav-title {
    font-size: 32rpx;
    font-weight: 300;
  }

  .nav-title::first-letter {
    font-size: 40rpx;
    margin-right: 4rpx;
  }

  .nav-name {
    font-size: 28rpx;
    text-transform: Capitalize;
    margin-top: 20rpx;
    position: relative;
  }

  .nav-name::before {
    content: "";
    position: absolute;
    display: block;
    width: 40rpx;
    height: 6rpx;
    background: #fff;
    bottom: 0;
    right: 0;
    opacity: 0.5;
  }

  .nav-name::after {
    content: "";
    position: absolute;
    display: block;
    width: 100rpx;
    height: 1px;
    background: #fff;
    bottom: 0;
    right: 40rpx;
    opacity: 0.3;
  }

  .nav-name::first-letter {
    font-weight: bold;
    font-size: 36rpx;
    margin-right: 1px;
  }

  .nav-li text {
    position: absolute;
    right: 30rpx;
    top: 30rpx;
    font-size: 52rpx;
    width: 60rpx;
    height: 60rpx;
    text-align: center;
    line-height: 60rpx;
  }

  .text-light {
    font-weight: 300;
  }
</style>
